package forceoffer;


import java.util.Scanner;
class FindArray2 {
	
	public static void main(String[] args) {
		int[][] array=new int[8][8];
		for (int i=0; i<8; i++) {
		    for (int j=0; j<8; j++) {
		        array[i][j]=(i+2)*(j+1);
		    }
		}
		//for (int i=0; i<8; i++) {
		//  System.out.println(Arrays.toString(array[i]));
		//}
		Scanner in=new Scanner(System.in);
		int target=in.nextInt();
		System.out.println(Find(target,array));
		
	}

	public static boolean Find(int target,int[][] array){

		int len=array.length;
		int i=0;
		while ((len>=0) && i<array[0].length){
			if (array[len][i]>target) {
				len--;
			}else if (array[len][i] <target) {
				i++;
			}else{
				return true;
			}
		}
		return false;
	}

}